<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('举报动态列表')"/>
    <!--<style>
        .select-table table {
            table-layout: fixed;
        }

        .select-table .table td {
            /* 超出部分隐藏 */
            overflow: hidden;
            /* 超出部分显示省略号 */
            text-overflow: ellipsis;
            /*规定段落中的文本不进行换行 */
            white-space: nowrap;
            /* 配合宽度来使用 */
            height: 40px;
        }
    </style>-->
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>举报人id：</p>
                            <input type="text" name="userId"/>
                        </li>
                        <li>
                            <p>动态举报内容：</p>
                            <input type="text" name="dynamicReportContent"/>
                        </li>
                        <li>
                            <p>动态举报类型：</p>
                           <!-- <select name="dynamicReportType" th:with="type=${@dict.getType('')}">
                                <option value="">所有</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>-->
                            <input type="text" name="dynamicReportType"/>
                        </li>
                        <!--<li>
                            <p>动态举报图片：</p>
                            <input type="text" name="dynamicReportImage"/>
                        </li>
                        <li class="select-time">
                            <p>举报时间：</p>
                            <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                   name="params[beginDynamicCreateTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                   name="params[endDynamicCreateTime]"/>
                        </li>-->
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:report:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:report:edit">
                <i class="fa fa-edit"></i> 修改
            </a>-->
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:report:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
           <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:report:export">
                <i class="fa fa-download"></i> 导出
            </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:report:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:report:remove')}]];
    var prefix = ctx + "app/dynamicreport";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "举报动态",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'userId',
                    title: '举报人id'
                },
                {
                    field: 'dynamicReportType',
                    title: '动态举报类型'
                },
                {
                    field: 'dynamicId',
                    title: '举报动态id'
                },
                {
                    field: 'dynamicReportContent',
                    title: '动态举报内容',
                    formatter: function (value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    field: 'ppFilesList',
                    title: '动态举报图片',
                    formatter: function (value, row, index) {
                        var str = '';
                        //遍历数组
                        for (var i = 0; i < value.length; i++) {
                            //1为图片 2为视屏
                            if (value[i].fileType == 1) {
                                str += "" + $.table.imageView(value[i].fileUrl, '/profile/avatar') + ""
                            } else {
                                str += '<video src="'+value[i].fileUrl+'" controls="controls" width="100"+px height="200"+px></video>'
                            }
                        }
                        return str;
                    }
                },
                {
                    field: 'dynamicCreateTime',
                    title: '举报时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        /*actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');*/
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    //删除对应的动态

</script>
</body>
</html>